package com.ftg.learn.chapter08.combination;

/**
 * @author kangjx
 * @createTime 2023/1/6
 */
public class A {

    private int privateInt = 13;

    int defaultInt = 14;

    protected  int protectedInt = 15;

    public int publicInt = 16;


    private String privateMethod(){
        System.out.println("本类调用");
        System.out.println(this.defaultInt);
        System.out.println(this.protectedInt);
        System.out.println(this.privateInt);
        System.out.println(this.publicInt);
        return "private method";
    }

    String defaultMethod(){
        System.out.println("本类调用");
        System.out.println(this.defaultInt);
        System.out.println(this.protectedInt);
        System.out.println(this.privateInt);
        System.out.println(this.publicInt);
        return "default method";
    }

    protected String protectedMethod(){
        System.out.println("本类调用");
        System.out.println(this.defaultInt);
        System.out.println(this.protectedInt);
        System.out.println(this.privateInt);
        System.out.println(this.publicInt);
        return "protected method";
    }


    public String publicMethod(){
        System.out.println("本类调用");
        System.out.println(this.defaultInt);
        System.out.println(this.protectedInt);
        System.out.println(this.privateInt);
        System.out.println(this.publicInt);
        return "public method";
    }

    public static void main(String[] args) {
        A a1 = new A();
//        a1.privateInt
//        a1.defaultInt
//        a1.protectedInt
//        a1.publicInt
    }



}
